<template>
	<view>
		<tabBar :tabList="tablist" @click="hotTab"></tabBar>
		<song-list v-show="currentIndex===0" :ablumArrayData="playList">
			<p slot="title"></p>
		</song-list>
		<singer-list  v-show="currentIndex===1" >
				<p slot="title"></p>
		</singer-list>
	</view>
</template>

<script>
	import tabBar from "../../components/tabbar.vue"
	import songList from "../../components/song-list.vue"
	import singerList from '../../components/singer-list.vue'
	export default {
		
		data() {
			return {
				playList:[],
				currentIndex:0,
				tablist: [{
						icon: '&#xe60d;',
						text: '热门歌单',
						to: "/pages/Recommand/Recommand"
					},
					{
						icon: '&#xe603;',
						text: '热门歌手',
						to: "/pages/Hot/Hot",
					},
					{
						to: "/pages/Search/Search",
						icon: '&#xe601;',
						text: '热门电台',
					}
				]
			}
		},
		components: {
			tabBar,
			songList,
			singerList
		},
		methods: {
			hotTab(index) {
				this.currentIndex = index;
			},
			async getHotAblum(){
				const res = await this.rq.fetchGet(this.apiUrl.hotAlbum,{})
				console.log(res[1].data)
				this.playList =res[1].data.playlists
			}
		},
		created() {
			this.getHotAblum()
		}
	}
</script>

<style>

</style>
